<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link rel="stylesheet" href="./CSS/reset.css">
  <link rel="stylesheet" href="./CSS/login.css">
</head>

<body>
  <div class="container">
    <!-- 注册 -->
    <div class="container-form container-signup">
      <form action="#" class="form" id="form1">
        <h2 class="form-title">手机号登录</h2>
        <input type="text" placeholder="手机号" class="input">
        <input type="text" placeholder="验证码" class="input">
        <a href="index.html" style="margin-top: 25px;"><button type="button" class="btn">登录</button></a>

      </form>
    </div>
    <!-- 登录 -->
    <div class="container-form container-signin">
      <form action="#" class="form" id="form2">
        <h2 class="form-title">密码登录</h2>
        <input type="text" placeholder="username" class="input">
        <input type="text" placeholder="密码" class="input">
        <a href="#" class="link">忘记密码</a>
        <a href="index.html"><button type="button" class="btn">登录</button></a>
      </form>
    </div>

    <div class="container-overlay">
      <div class="overlay">
        <div class="overlay-panel overlay-left">
          <button class="btn" id="signIn">账号密码登录</button>
        </div>
        <div class="overlay-panel overlay-right">
          <button class="btn" id="signUp">手机号登录</button>
        </div>
      </div>
    </div>
  </div>

  <script>
    const signInBtn = document.querySelector('#signIn')
    const signUpBtn = document.querySelector('#signUp')
    const container = document.querySelector('.container')
    signInBtn.addEventListener("click", () => {
      container.classList.remove("panel-active")
    })
    signUpBtn.addEventListener("click", () => {
      container.classList.add("panel-active")
    })
  </script>
</body>

</html>